package io.github.lee.app.unsplash.repository

import io.github.lee.app.unsplash.repository.api.UserApi
import io.github.lee.app.unsplash.repository.domain.Photo
import io.github.lee.app.unsplash.repository.domain.UnsplashResponse
import io.github.lee.app.unsplash.repository.params.OrderBy
import io.github.lee.app.unsplash.repository.params.Orientation
import javax.inject.Inject

class UserRepository @Inject constructor(
    private val api: UserApi
) {

    suspend fun userPhotoList(
        username: String,
        page: Int,
        size: Int,
        orderBy: OrderBy = OrderBy.Latest,
        stats: Boolean? = false,
        resolution: String? = "days",
        quantity: Int? = 30,
        orientation: Orientation? = null
    ): UnsplashResponse<List<Photo>> =
        api.userPhotoList(
            username, page, size,
            orderBy.value, stats, resolution, quantity,
            orientation?.value
        )
}